How to update incident status via the EventsAPI

I am trying to figure out how to take a previous incident pulled from the REST API, and update the incident status using the Events API and the pdpyras package.

I was able to get the dedup_key by using the answer from Doug in this thread, but when I use the dedup_key in the .acknowledge() or .resolve() methods found in the pdpyras documentation and then hit the REST API again, the status has not changed, nor has it changed on the web interface.

Hi Alex.

If you’re doing a bunch of testing on one service, double check that alert grouping isn’t being helpful:

If you want to ack or resolve that whole incident, you’ll have to use the Rest API to do it; there aren’t .acknowledge() or .resolve() methods built in to the APISession in pdpyras. If you’ve already got the incident ID, you can do something like:

my_incident = session.rget('/incidents/$ID')
my_incident['status'] = "acknowledged"
updated_incident = session.rput('/incidents/$ID', json=my_incident)
1 Like